package com.smartinput.sse.application.dto

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonIgnoreProperties

@JsonIgnoreProperties(ignoreUnknown = true)
data class SSEMessage @JsonCreator constructor(
    @JsonProperty("type") val type: String,
    @JsonProperty("data") val data: Any,
    @JsonProperty("timestamp") val timestamp: Long = System.currentTimeMillis()
)

data class NotificationRequest(
    val title: String,
    val message: String,
    val type: String = "info",
    val targetDeviceId: String? = null
)

data class SSEConnection(
    val deviceId: String,
    val emitter: org.springframework.web.servlet.mvc.method.annotation.SseEmitter
) 